package psnl.bingo.mr.demo2;

import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.mapreduce.Partitioner;

public class D2ReduceOutPart extends Partitioner<D2Line, NullWritable> {
    @Override
    public int getPartition(D2Line seLineObj, NullWritable nullWritable, int numPartitions) {
        // numPartitions 等于 job.setNumReduceTasks的值，本方法返回的数值应<=NumReduceTasks，最好等于

        return Integer.parseInt(seLineObj.getYear()) % numPartitions;
    }
}
